package drh.servlet;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;

public class BaseServlet extends HttpServlet {
	protected HttpServletRequest request;
	protected HttpServletResponse response;
	Gson gson = new Gson();
	
	
	public boolean isNull(String key) {
		return request.getParameter(key)==null;
	}
	
	public Integer getInt(String key) {
		if(!isNull(key))
			return Integer.parseInt(request.getParameter(key));
		return null;
	}
	
	public String getString(String key) {
		if(!isNull(key))
			return request.getParameter(key);
		return null;
	}
	
}
